import os


class Config:
    DEBUG = False
    BASE_DIR = os.path.dirname(os.path.abspath(__file__))
    BABEL_DEFAULT_LOCALE = "zh_CN"
    SQLALCHEMY_TRACK_MODIFICATIONS = False  # 动态追踪设置
    # 需要注册，以便admin、migrate等识别
    APP = [
        'app',
    ]


class Dev(Config):
    DEBUG = True
    SECRET_KEY = 'dev'
    SQLALCHEMY_ECHO = True  # 是否打印sql

    DATABASES = {
        "DIALCT": 'mysql',
        "DRITVER": 'pymysql',
        "HOST": '127.0.0.1',
        "PORT": '3306',
        "DBNAME": 'ccbflask',
        "USER": 'root',
        "PASSWORD": '1234qwer',
        "CHARSET": 'utf8mb4'
    }

    SQLALCHEMY_DATABASE_URI = "{DIALCT}+{DRITVER}://{USER}:{PASSWORD}@{HOST}:{PORT}/{DBNAME}?charset={CHARSET}"
    SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE_URI.format(**DATABASES)

    # SQLALCHEMY_DATABASE_URI = "sqlite:///test2.db"

    SQLALCHEMY_TRACK_MODIFICATIONS = True


class Pro(Config):
    pass
